using System;
using System.Collections.Generic;
using WDFactoryLib;

namespace CardsEngine
{
	/// <summary>
	/// Represents a Player who has a hand of cards and a position in the turn rotation
	/// </summary>
	public class CardsPlayer: FactoryUser
	{
		private Player owner;
		private IList<Card> hand;

		public CardsPlayer (Player _owner)
            :base()
		{
            InitializeInstance(_owner);
		}

        public CardsPlayer(IFactory _factory, Player _owner)
            : base(_factory)
        {
            InitializeInstance(_owner);
        }

        private void InitializeInstance(Player _owner)
        {
            owner = _owner;
            hand = Factory.GetNewList<Card>();
        }

		/// <summary>
		/// Gets the hand.
		/// </summary>
		/// <value>
		/// The hand.
		/// </value>
		public IList<Card> Hand {
			get { return hand; }
		}


		/// <summary>
		/// Gets the owner. (Read-Only)
		/// </summary>
		/// <value>
		/// The owner.
		/// </value>
		public Player Owner {
			get { return owner; }
		}
	}
}

